package com.bone.order.service.impl;

import java.util.List;
import java.util.Map;

import com.bone.business.po.Business;
import com.bone.order.dao.OrdOrderDAO;
import com.bone.order.dao.OrdOrderProdDAO;
import com.bone.order.dao.OrdSaleServiceDAO;
import com.bone.order.po.OrdOrder;
import com.bone.order.po.OrdOrderProd;
import com.bone.order.service.OrderService;
import com.bone.page.Page;

public class OrderServiceImpl implements OrderService {

	
	private OrdOrderDAO orderDAO;
	
	private OrdSaleServiceDAO ordSaleServiceDAO;
	
	private OrdOrderProdDAO orderProdDAO;

	/**
	 * order 数据列表.
	 * @param parameter
	 * @return
	 */
	public Page<OrdOrder> queryOrderPageByParam(Map<String, Object> parameter,
			int pageSize, int page) {
		Page pageConfig = Page.page(pageSize, page);
		return this.orderDAO.queryOrderPageByParam(parameter, pageConfig);
	}
	/**
	 * 取符合条件的数量.
	 * @param para
	 * @return
	 */
	public Long queryOrderCountByParam(Map<String, Object> para){
		return orderDAO.queryOrderCountByParam(para);
	}
	
	/**
	 * 
	 * @param parameter
	 * @return
	 */
	public List<OrdOrder> queryOrderListByParam(Map<String, Object> parameter){
		return orderDAO.queryOrderListByParam(parameter);
	}
	
	/**
	 * 根据订单ID取订单信息.
	 * @param orderId
	 * @return
	 */
	public OrdOrder queryOrderById(Long orderId){     
		 return this.orderDAO.queryOrderById(orderId);
	}
	/**
	 * 根据订单号取订单信息
	 * @param orderNo
	 * @return
	 */
	public OrdOrder queryOrderByOrderNo(String orderNo){
		return this.orderDAO.queryOrderByOrderNo(orderNo);
	}
	
	//--------ord_order_prod-----------------------------------------------------
	/**
	 * 根据订单ID取订单子产品.
	 * @param orderId
	 * @return
	 */
	public List<OrdOrderProd> queryOrdOrderProdListByOrderId(Long orderId){ 
		return this.orderProdDAO.queryOrdOrderProdListByOrderId(orderId);
	}
	
	
	
	//--------ord_order_sale----------------------------------------------------
	 
	
	public OrdOrderDAO getOrderDAO() {
		return orderDAO;
	}
	public void setOrderDAO(OrdOrderDAO orderDAO) {
		this.orderDAO = orderDAO;
	}
	public OrdSaleServiceDAO getOrdSaleServiceDAO() {
		return ordSaleServiceDAO;
	}
	public void setOrdSaleServiceDAO(OrdSaleServiceDAO ordSaleServiceDAO) {
		this.ordSaleServiceDAO = ordSaleServiceDAO;
	}
	public OrdOrderProdDAO getOrderProdDAO() {
		return orderProdDAO;
	}
	public void setOrderProdDAO(OrdOrderProdDAO orderProdDAO) {
		this.orderProdDAO = orderProdDAO;
	}
	
}
